//
//  Pirate_FlagAppDelegate.m
//  Pirate Flag
//
//  Created by jeff on 4/8/09.
//  Copyright Jeff LaMarche 2009. All rights reserved.
//

#import "Pirate_FlagAppDelegate.h"
#import "GLViewController.h"
#import "GLView.h"



@implementation Pirate_FlagAppDelegate
@synthesize window;
@synthesize controller;

- (void)applicationDidFinishLaunching:(UIApplication*)application
{
	
    UIScreen *mainScreen = [UIScreen mainScreen];
    CGRect	rect = [mainScreen bounds];
	window = [[UIWindow alloc] initWithFrame:rect];
	
	GLViewController *theController = [[GLViewController alloc] init];
	self.controller = theController;
	[theController release];
	
	GLView *glView = [[GLView alloc] initWithFrame:rect];
	[window addSubview:glView];

	glView.controller = controller;
	glView.animationInterval = 1.0 / kRenderingFrequency;
    [glView startAnimation];
	[glView release];
	
	
    [window makeKeyAndVisible];
   
}

- (void)dealloc
{
	[window release];
	[controller release];
	[super dealloc];
}
@end
